package View.FilialView;

import java.awt.Dimension;

import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JButton;
import javax.swing.JLabel;

import Controller.FilialController.FilialController;
import Entidade.Filial;
import framework.component.field.TTextField;
import framework.mvc.GenericView;

public class FilialView extends GenericView<Filial> {

	private static final long serialVersionUID = 5496353135744999155L;
	private TTextField textField;
	private TTextField textField_1;
	private TTextField textField_2;
	private TTextField textField_3;
	private TTextField textField_4;

	public FilialView() {
		super(new FilialController());
		setTitle("Fox Empresarial - Cadastro de Filiais");
		setSize(new Dimension(450, 210));

		JButton button = new JButton("Salvar");
		button.setName("salvar");

		JButton button_1 = new JButton("Cancelar");
		button_1.setName("cancelar");

		JLabel label = new JLabel("Nome:");

		JLabel label_1 = new JLabel("Fantasia:");

		JLabel label_2 = new JLabel("CNPJ:");

		JLabel label_3 = new JLabel("Insc. Estadual:");

		JLabel label_4 = new JLabel("Telefone:");

		textField = new TTextField();
		textField.setName("TelefoneFilial");
		textField.setColumns(10);

		textField_1 = new TTextField();
		textField_1.setName("InscricaoEstadualFilial");
		textField_1.setColumns(10);

		textField_2 = new TTextField();
		textField_2.setName("CNPJFilial");
		textField_2.setColumns(10);

		textField_3 = new TTextField();
		textField_3.setName("FantasiaFilial");
		textField_3.setColumns(10);

		textField_4 = new TTextField();
		textField_4.setName("NomeFilial");
		textField_4.setColumns(10);
		GroupLayout groupLayout = new GroupLayout(getContentPane());
		groupLayout
				.setHorizontalGroup(groupLayout
						.createParallelGroup(Alignment.LEADING)
						.addGroup(
								groupLayout
										.createSequentialGroup()
										.addContainerGap()
										.addGroup(
												groupLayout
														.createParallelGroup(
																Alignment.LEADING)
														.addGroup(
																groupLayout
																		.createSequentialGroup()
																		.addComponent(
																				label,
																				GroupLayout.PREFERRED_SIZE,
																				31,
																				GroupLayout.PREFERRED_SIZE)
																		.addGap(62)
																		.addComponent(
																				textField_4,
																				GroupLayout.PREFERRED_SIZE,
																				279,
																				GroupLayout.PREFERRED_SIZE))
														.addGroup(
																groupLayout
																		.createSequentialGroup()
																		.addComponent(
																				label_1,
																				GroupLayout.PREFERRED_SIZE,
																				45,
																				GroupLayout.PREFERRED_SIZE)
																		.addGap(48)
																		.addComponent(
																				textField_3,
																				GroupLayout.PREFERRED_SIZE,
																				279,
																				GroupLayout.PREFERRED_SIZE))
														.addGroup(
																groupLayout
																		.createSequentialGroup()
																		.addComponent(
																				label_2,
																				GroupLayout.PREFERRED_SIZE,
																				29,
																				GroupLayout.PREFERRED_SIZE)
																		.addGap(64)
																		.addComponent(
																				textField_2,
																				GroupLayout.PREFERRED_SIZE,
																				279,
																				GroupLayout.PREFERRED_SIZE))
														.addGroup(
																groupLayout
																		.createSequentialGroup()
																		.addComponent(
																				label_3,
																				GroupLayout.PREFERRED_SIZE,
																				72,
																				GroupLayout.PREFERRED_SIZE)
																		.addGap(21)
																		.addComponent(
																				textField_1,
																				GroupLayout.PREFERRED_SIZE,
																				279,
																				GroupLayout.PREFERRED_SIZE))
														.addGroup(
																groupLayout
																		.createSequentialGroup()
																		.addComponent(
																				label_4)
																		.addGap(47)
																		.addComponent(
																				textField,
																				GroupLayout.PREFERRED_SIZE,
																				279,
																				GroupLayout.PREFERRED_SIZE))
														.addGroup(
																groupLayout
																		.createSequentialGroup()
																		.addGap(226)
																		.addComponent(
																				button,
																				GroupLayout.PREFERRED_SIZE,
																				63,
																				GroupLayout.PREFERRED_SIZE)
																		.addGap(8)
																		.addComponent(
																				button_1,
																				GroupLayout.PREFERRED_SIZE,
																				75,
																				GroupLayout.PREFERRED_SIZE)))
										.addContainerGap(52, Short.MAX_VALUE)));
		groupLayout
				.setVerticalGroup(groupLayout
						.createParallelGroup(Alignment.LEADING)
						.addGroup(
								groupLayout
										.createSequentialGroup()
										.addContainerGap()
										.addGap(1)
										.addGroup(
												groupLayout
														.createParallelGroup(
																Alignment.LEADING)
														.addGroup(
																groupLayout
																		.createSequentialGroup()
																		.addGap(3)
																		.addComponent(
																				label))
														.addComponent(
																textField_4,
																GroupLayout.PREFERRED_SIZE,
																GroupLayout.DEFAULT_SIZE,
																GroupLayout.PREFERRED_SIZE))
										.addGap(6)
										.addGroup(
												groupLayout
														.createParallelGroup(
																Alignment.LEADING)
														.addGroup(
																groupLayout
																		.createSequentialGroup()
																		.addGap(3)
																		.addComponent(
																				label_1))
														.addComponent(
																textField_3,
																GroupLayout.PREFERRED_SIZE,
																GroupLayout.DEFAULT_SIZE,
																GroupLayout.PREFERRED_SIZE))
										.addGap(11)
										.addGroup(
												groupLayout
														.createParallelGroup(
																Alignment.LEADING)
														.addGroup(
																groupLayout
																		.createSequentialGroup()
																		.addGap(3)
																		.addComponent(
																				label_2))
														.addComponent(
																textField_2,
																GroupLayout.PREFERRED_SIZE,
																GroupLayout.DEFAULT_SIZE,
																GroupLayout.PREFERRED_SIZE))
										.addGap(11)
										.addGroup(
												groupLayout
														.createParallelGroup(
																Alignment.LEADING)
														.addGroup(
																groupLayout
																		.createSequentialGroup()
																		.addGap(3)
																		.addComponent(
																				label_3))
														.addComponent(
																textField_1,
																GroupLayout.PREFERRED_SIZE,
																GroupLayout.DEFAULT_SIZE,
																GroupLayout.PREFERRED_SIZE))
										.addGap(11)
										.addGroup(
												groupLayout
														.createParallelGroup(
																Alignment.LEADING)
														.addGroup(
																groupLayout
																		.createSequentialGroup()
																		.addGap(3)
																		.addComponent(
																				label_4))
														.addComponent(
																textField,
																GroupLayout.PREFERRED_SIZE,
																GroupLayout.DEFAULT_SIZE,
																GroupLayout.PREFERRED_SIZE))
										.addGap(11)
										.addGroup(
												groupLayout
														.createParallelGroup(
																Alignment.LEADING)
														.addComponent(button)
														.addComponent(button_1))
										.addContainerGap(18, Short.MAX_VALUE)));
		getContentPane().setLayout(groupLayout);
	}
}
